import { fileURLToPath, URL } from "node:url";
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      '/api': {
        target: 'http://git.dev.oa.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '/api/v4'),
      },
      '/oauth': {
        target: 'http://git.dev.oa.com',
        changeOrigin: true,
      },
    },
  },
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
})
